package main

import (
	"fmt"
	"study/javaMybatisGen/gen"
	"time"
)

func main() {
	gen.ConfDir = "./config/"
	gen.DbInit("db/db.xml")
	sleep()
	var projects = gen.ProjectInit("project.xml")
	fmt.Printf("%+v\n", projects)
	sleep()
	var modules = gen.ModuleInit(projects, "module.xml")
	fmt.Printf("%+v\n", modules)
	sleep()
	gen.GenDomain(modules)
	sleep()
	gen.GenService(modules)
	sleep()
	gen.GenDao(modules)
	sleep()
	gen.GenController(modules)
	sleep()
	gen.GenMapper(modules)
	sleep()
	fmt.Println("Gen Success 60秒后关闭")
	time.Sleep(time.Second * 60)
}

func sleep() {
	time.Sleep(time.Second / 2)
}
